package com.work.mvc.controler;

import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
import com.work.db.entity.PresentsTypeEnum;
import com.work.mvc.view.form.WorkDayForm;

public class WorkDayFormController implements ValueChangeListener {

	private static final long serialVersionUID = -4144877435499554728L;

	private WorkDayForm view;
	
	public WorkDayFormController(WorkDayForm view) {
		this.view = view;
	}

	@Override
	public void valueChange(ValueChangeEvent event)
	{
		PresentsTypeEnum presentsType = (PresentsTypeEnum) event.getProperty().getValue();
		view.switchFieldsOnPresentsType(presentsType, true);
	}
}
